/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package bsk_dac.accesscontrol;

import java.util.EnumMap;
import java.util.Map;

/**
 *
 * @author przemo
 */
abstract public class Access {

    protected Map<AccessType, Boolean> privileges;
    protected Map<AccessType, Boolean> userGivePermission;


    public Access() {
        privileges = new EnumMap<AccessType, Boolean>(AccessType.class);
        userGivePermission = new  EnumMap<AccessType, Boolean>(AccessType.class);
        fillAccessDefaultPrivileges();
    }

    public void setPrivileges(AccessType accessType, boolean status) {
        privileges.put(accessType, status);
    }

    public void setUserGivePermission(AccessType accessType, boolean status) {
        userGivePermission.put(accessType, status);
    }

    public boolean getPrivilegesStatus(AccessType accessType) {
        return privileges.get(accessType);
    }

    public boolean getUserGivePermission(AccessType accessType){
        return userGivePermission.get(accessType);
    }

    abstract protected void fillAccessDefaultPrivileges();
}
